@php
    $btnSizes = ['lg'=>'btn-lg','sm'=>'btn-sm','xs'=>'btn-xs','md'=>''];
    $btnColors = [
                    'primary'=>'btn-primary','success'=>'btn-success','info'=>'btn-info'
                    ,'warning'=>'btn-warning','danger'=>'btn-danger','secondary'=>'btn-secondary'
                    ,'dark'=>'btn-dark','light'=>'btn-light'
                ];

     $attr = $attr ?? '';
     $class = $class ?? '';
    if (isset($elem)&&$elem == 'a'){
        $href = $href??'javascript:;';
        $attr.= ' href='.$href;
    }else{
        $type = $type ?? 'button';
        $attr.= ' type='.$type;
    }
    $size = $btnSizes[isset($size)?(string)$size:'sm'];
    $color = $color ?? 'primary';
    $class .= ' btn '.$size.' btn-'.$color;
@endphp

<{{$elem??'button'}}  {{$attr ?? ''}} class ="{{$class ?? ''}}" @if(isset($params)) data-params='{{$params ??''}}' @endif>
    @if(isset($icon))<i class="hcl {{$icon}}"></i>@endif {{$title ?? ''}}
</{{$elem??'button'}}>